package com.lianzhihui.romeex.utils;

/**
 * Description:
 * Author: RAMON
 * CreateDate: 2020/11/2 4:03 PM
 * UpdateUser:
 * UpdateDate:
 * UpdateRemark:
 * Version:
 */
public class TextUtil {


    /**
     * 检测 安全码是否符合规则
     *
     * @param safty
     * @return
     */
    public static boolean checkSaftyCode(String safty) {
        if (isDigit(safty)) {
            if (safty.length() == 6) {
                return true;
            }
        }
        return false;
    }

    /**
     * 字符串是否纯数字
     *
     * @param str
     * @return
     */
    public static boolean isDigit(String str) {
        for (int i = str.length(); --i >= 0; ) {
            if (!Character.isDigit(str.charAt(i))) {
                return false;
            }
        }
        return true;
    }

}
